package JHfstools;

import java.awt.EventQueue;

import javax.swing.JDialog;
import java.awt.Color;
import java.awt.FlowLayout;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;

import javax.swing.JEditorPane;
import javax.swing.JButton;
import javax.swing.ImageIcon;
import javax.swing.JScrollPane;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class hfthelpdlg extends JDialog {
	private JEditorPane hftHelpeditpane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					hfthelpdlg dialog = new hfthelpdlg();
					dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
					dialog.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the dialog.
	 */
	public hfthelpdlg() {
		getContentPane().setBackground(new Color(245, 255, 250));
		getContentPane().setLayout(null);
		
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setBounds(10, 11, 682, 588);
		scrollPane.setSize(682,588);
		getContentPane().add(scrollPane);
		
		hftHelpeditpane = new JEditorPane();
		scrollPane.setViewportView(hftHelpeditpane);
		
		JButton hhthelpok = new JButton("");
		hhthelpok.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				dispose();
			}
		});
		hhthelpok.setIcon(new ImageIcon(hfthelpdlg.class.getResource("images/dlgok.png")));
		hhthelpok.setBounds(10, 610, 41, 41);
		getContentPane().add(hhthelpok);
		
		JButton hfthelpcan = new JButton("");
		hfthelpcan.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				dispose();
			}
		});
		hfthelpcan.setIcon(new ImageIcon(hfthelpdlg.class.getResource("images/dlgcan.png")));
		hfthelpcan.setBounds(651, 610, 41, 41);
		getContentPane().add(hfthelpcan);
		setTitle("HFS Tools Help");
		setBounds(100, 100, 710, 708);
		File hfile = new File("HFThelp.html");
		URL helpurl = null;
		try {
			helpurl = hfile.toURI().toURL();
		} catch (MalformedURLException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		try {
			hftHelpeditpane.setPage(helpurl);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		hftHelpeditpane.setVisible(true);
		hftHelpeditpane.setSize(1204, 768);

	}
	public JEditorPane getHftHelpeditpane() {
		return hftHelpeditpane;
	}
}
